﻿namespace eg_081_基类构造函数
{
    internal class Program
    {    //动物类

        class Animal
        {
            string name = "";
            string food = "";
            public Animal(string name, string food)
            {
                this.name = name;
                this.food = food;

            }
            protected void Feed()
            {
                Console.WriteLine("饲养员给{0}喂{1}", this.name, this.food);
            }
        }

        // 熊猫类
        class Panda : Animal
        {
            public Panda(string name, string food) : base(name, food)
            {
                Feed();
            }
        }
        static void Main(string[] args)
        {
            Animal panda = new Panda("熊猫", "珠子");
        }
    }
}